package com.cn.netty.customize.server;

import com.cn.netty.customize.BusinessMeassage;
import com.cn.netty.customize.BusinessMessageType;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class HearBeatResHandler extends ChannelInboundHandlerAdapter {

  @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) {
    if (msg instanceof BusinessMeassage) {
      log.info("{}", msg);
      ChannelFuture channelFuture = ctx.writeAndFlush(BusinessMessageType.buildHeartBeatRes());

    }
  }

}
